package com.ywh.hilttest

import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class ContainerActivity : FragmentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val clazzName = intent.getStringExtra("containerClassName").orEmpty()
        this.supportFragmentManager.beginTransaction()
            .replace(android.R.id.content, Class.forName(clazzName).newInstance() as Fragment, clazzName)
            .commitNow()
    }
}